package com.czk.ssafunctioncalling.util;

import lombok.extern.slf4j.Slf4j;
import org.springframework.ai.tool.annotation.Tool;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;

/**
 * @Author: chenzhangkun
 * @CreateTime: 2025-11-02
 * @Description:
 * @Version: 1.0
 */
@Service
@Slf4j
public class DateTimeTools {

    /**
     * 定义一个工具类，用于获取当前时间
     * returnDirect=true直接给客户，不走大模型
     * returnDirect=false 走大模型，由大模型进行回复
     *
     * @return
     */
    @Tool(description = "获取当前时间", returnDirect = false)
    public String getCurrentTime() {
        log.info("获取当前时间");
        String timeStr = LocalDateTime.now().toString();
        log.info("当前时间：{}", timeStr);
        return timeStr;

    }

}
